﻿#ifndef QUICKLISTITEMMODEL_H
#define QUICKLISTITEMMODEL_H

#include <QObject>
#include "XuanCommon_global.h"

//该类为item提供其他的特性
//例如: 被选中  被框中
class  XUANCOMMON_EXPORT QuickListItemModel : public QObject
{
    Q_OBJECT
    Q_PROPERTY(bool isChecked READ isChecked WRITE setIsChecked NOTIFY isCheckedChanged)
    Q_PROPERTY(bool isSelected READ isSelected WRITE setIsSelected NOTIFY isSelectedChanged)
    Q_PROPERTY(bool isVisible READ isVisible WRITE setIsVisible NOTIFY isVisibleChanged)
    Q_PROPERTY(bool isAlternate READ isAlternate WRITE setIsAlternate NOTIFY isAlternateChanged)
public:
    explicit QuickListItemModel(QObject *parent = nullptr);
    explicit QuickListItemModel(const QuickListItemModel &others ){
        this->m_isAlternate = others.m_isAlternate;
        this->m_isChecked = others.m_isChecked;
        this->m_isSelected = others.m_isSelected;
        this->m_isVisible = others.m_isVisible;
    };
    QuickListItemModel &operator=(const QuickListItemModel &others){
        this->m_isAlternate = others.m_isAlternate;
        this->m_isChecked = others.m_isChecked;
        this->m_isSelected = others.m_isSelected;
        this->m_isVisible = others.m_isVisible;
        return *this;
    }
    ~QuickListItemModel()override;
    virtual bool match(const QString &key){
        return true;
    }

    bool isChecked() const;
    void setIsChecked(bool newIsChecked);
    bool isSelected() const;
    void setIsSelected(bool newIsSelected);
    bool isVisible() const;
    void setIsVisible(bool newIsVisible);
    bool isAlternate() const;
    void setIsAlternate(bool newIsAlternate);

signals:

    void isCheckedChanged(bool isChecked);
    void isSelectedChanged(bool isSelected);
    void isVisibleChanged(bool isVisible);
    void isAlternateChanged(bool isAltermate);

private:
    bool m_isChecked = false;
    bool m_isSelected = false;
    bool m_isVisible = true;
    bool m_isAlternate = false;



};

#endif // QUICKLISTITEMMODEL_H
